﻿ <div id="mainContent">
    <div id="sidebar">
		<div class="boxes">
			<h2>Bài ngẫu nhiên</h2>
			<div class="randomPosts">
				<ul id="lastest">
					<?php 
					$randomPosts = new WP_Query();
					$randomPosts->query('showpost=5&orderby=rand');
					while($randomPosts->have_posts()):$randomPosts->the_post()?>
					<li>
						<?php $thumb = get_post_meta($post->ID,'hình đại diện',true);?>
						<img src="<?php bloginfo('stylesheet_directory')?>/timthumb.php?src=<?php echo $thumb;?>&amp;h=60;&amp;w=60;zc=1" alt="avatar"/>
						<h4><a href="<?php the_permalink();?>"><?php the_title();?></a></h4>
					</li>
					<?php endwhile; ?>
				</ul>
			</div>
		</div>
		<?php 
			if(!function_exists('dynamic_sidebar') || !dynamic_sidebar()): ?>				
		<?php endif;?>	
    </div>
    <!-- end #sidebar-->